update r_workflow_model
set r_wkf_mdl_rules=
'<?xml version="1.0" encoding="utf-8"?>
<Rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" UseGlobalActionOnly="false">
  <WkfStates>
    <WkfState Value="Started">
      <Actions>
        <Action Identifier="1400" UiTypeAction="Index" ValidatingMode="One" ValidatingState="Read">
          <Conditions>
            <Condition Target="Document" IsFinalState="false" StateMode="One" NewState="Indexed" />
            <Condition Target="Workflow" IsFinalState="true" NewState="Finished">
              <If Operator="Or">
                <States>
                  <State Target="Document" StateMode="All" Value="Indexed" />
                  <State Target="Document" StateMode="All" Value="Rejected" />
                </States>
              </If>
            </Condition>
          </Conditions>
        </Action>
        <Action Identifier="1401" UiTypeAction="Refuse" >
          <Conditions>
            <Condition Target="Document" IsFinalState="false" StateMode="One" NewState="Rejected" />
            <Condition Target="Workflow" IsFinalState="true" NewState="Finished">
              <If Operator="Or">
                <States>
                  <State Target="Document" StateMode="All" Value="Indexed" />
                  <State Target="Document" StateMode="All" Value="Rejected" />
                </States>
              </If>
            </Condition>
          </Conditions>
        </Action>
        <Action Identifier="0" UiTypeAction="Revive" IsOption="true" IsSenderOnly="true"/>
      </Actions>
    </WkfState>
    <WkfState Value="Finished">
      <Actions>
        <Action Identifier="1000" UiTypeAction="Ventilate" IsSenderOnly="true"/>
      </Actions>
    </WkfState>
  </WkfStates>
</Rules>'
where r_wkf_mdl_id = 5